<template>
	<view class="app">
		<!-- 主要内容 -->
		<main-index />

		<!-- 引导关注公众号-->
		<official-account></official-account>
	</view>
</template>

<script>
// 首页
import MainIndex from './src/index.vue';

export default {
	components: {
		MainIndex
	},
	data() {
		return {
			active: 0,
			tabbar: ['首页', '课程', '预约', '我的']
		};
	},
	methods: {},
	onShow() {
		// 有token时间戳
		console.log('上次token时间', uni.$u.timeFormat(uni.getStorageSync('tokenTime'), 'yyyy年mm月dd日'));
		if (uni.getStorageSync('tokenTime')) {
			if (new Date().getTime() - uni.getStorageSync('tokenTime') > 86400000) {
				// 如果时间戳差距大于一天 就清内存重新登录

				// 无时间戳,清内存重新登录
				uni.clearStorageSync();
			}
		} else {
			// 无时间戳,清内存重新登录
			uni.clearStorageSync();
		}
	}
};
</script>
<style>
page {
	background-image: repeating-linear-gradient(to right, #eef3fa, #f6ecef);
}
</style>
<style lang="scss" scoped>
.app {
	height: 100vh;
	background-color: #d2e8eb;
	background-image: repeating-linear-gradient(to right, #eef3fa, #f6ecef);
}
.tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	box-shadow: 0 -1px 1px rgba(100, 100, 100, 0.2);
	height: 100rpx;
	border-radius: 50rpx 50rpx 0 0;
	background-color: #fff;
	display: flex;
	justify-content: space-around;
	align-items: center;
	.tabbar-item {
		// background-color: #d2e8eb;
		width: 170rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}
	.text {
		// width: 120rpx;
		// background-color: aqua;
	}
	.active {
		margin-top: 5rpx;
		height: 20rpx;
		width: 70rpx;
		background-color: #d2e8eb;
		border-radius: 10rpx;
	}
}
</style>
